﻿@{
    ViewBag.Title = "ProjectList";
    Layout = null;
    List<KingRoad.EPM.ProjectInfoEntity.PROJECT_PRJINFO> ProjectList = ViewBag.ProList as List<KingRoad.EPM.ProjectInfoEntity.PROJECT_PRJINFO>;
}
@using KingRoad.EPM.Common.Helper
<script type="text/javascript">
    function SelectProject(id,pName) {
        $.post("/Home/SetCurrentProject/", { "proID": id }, function (json) {
            if (json.statusCode == DWZ.statusCode.ok) {
                globe_projectId = id;
                $("#spProjectName_Home").html(pName);
                navTab.closeAllTab(); //关闭所有的标签页
                $.pdialog.closeCurrent(); //关闭当前弹窗
            }
            else {
                DWZ.ajaxDone(json);
            }
        }, "json");
    }
</script>

<div class="pageFormContent" layouth="4" style="padding:0;">
        @{
            if (ProjectList != null)
            {
                for (int i = 0; i < ProjectList.Count; i++)
                {
                    <div class="programSwitch">
                        <em style="display:none;">@ProjectList[i].PRJINFO_ID</em>
                        <span>@ProjectList[i].PRJINFO_NAME</span>
                        <input type="button" class="btn btn-success btn-sm" value="选择"onclick="SelectProject('@ProjectList[i].PRJINFO_ID','@ProjectList[i].PRJINFO_NAME')">
                    </div>
                }
            }
        }
</div>
